from Base import message, intersect, SS_VALID
from DRG import MDCF_DRG

def group(record):
  adrg_zd = ["I48.000","I48.100","I48.100x002","I48.100x003","I48.200","I48.300","I48.301","I48.400","I48.401","I48.900x003","I48.900x004","I48.900x015"]
  adrg_zd1 = []
  adrg_ss = ["37.3302","37.3303","37.3401","37.3402","37.3403","37.3404","37.3405","37.3406","37.3702"]
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and record.ssList and record.ssList[0] in adrg_ss:
    message('符合FL2入组条件，匹配规则：主诊断匹配、主手术匹配')

    if MDCF_DRG.FL29_group(record):
      return 'FL29'
        
    return 'FL2'
  else:
    return ''
    
